The most portable way to compare against the nil ptr is to compare against '0'. Some programmers use a #define to set NULL to '0', but that can conflict with the way the standard libraries #define NULL. There is no portable way to define a 'const' ptr called 'NULL' that can be compared against any arbitrary ptr -- the literal '0' is acceptable for this however.